<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>登录</title>
<link rel="shortcut icon" href="favicon.ico" type="image/x-icon">
<link href="./css/register.css" type="text/css" rel="stylesheet">
<!--[if IE 6]>
<script type="text/javascript" src="./js/ie6-min.js"></script>
<script type="text/javascript">
DD_belatedPNG.fix('.png, background,img');
</script>
<![endif]-->
</head>
<body>
<div class="header" style="height: 30px;" id="header"></div>
<div class="login-container" id="container-height" style="height: 541px;">
    <div class="png login-cover-layer">
        <div class="login-content" id="main">
            <div class="login-left">
                <div class="login-left-header">
                    <div class="title">云办公</div>
                </div>
                <div id="msg-ct" class="png login-left-body-common">
                                        <div class="company-info" style="height:340px;padding:30px 0;overflow:hidden">
                        
                    </div>
                                    </div>
            </div>
            <div class="login-right">
                <div class="login-box">
                    <div class="login-box-header">
                        <div class="login-logo"><img src="#" class="png" border="0"></div>
                    </div>
                    <div class="login-box-body">
                        <form action="#" method="post" class="login-form" id="loginform">
                            <table border="" cellpadding="0" cellspacing="0" align="center">
                                <tbody><tr>
                                    <th align="right">&nbsp;</th>
                                    <td align="left"><div class="login-title">登录云办公系统</div></td>
                                </tr>
                                <tr>
                                    <th align="right" style="padding-top:0;padding-bottom:0;"></th>
                                    <td align="left" style="padding-top:0;padding-bottom:0;height:16px"><div class="red" style="font-size:12px;color:#f00"></div></td>
                                </tr>
                                <tr>
                                    <th align="right">帐号：</th>
                                    <td align="left"><div class="input-text-wrap"><input id="uid" name="uid" type="text" size="30" class="input-text" style="width:280px;"><img id="avatar" src="https://www.tudu.im/img/spacer.gif" style="display:none;width:34px;height:34px"></div></td>
                                </tr>
                                <tr>
                                    <th align="right">密码：</th>
                                    <td align="left"><input id="password" name="password" type="password" size="30" class="input-text" style="width:280px;"></td>
                                </tr>
                                <tr id="seccode-tr" style="display:none">
                                    <th align="right" valign="top" style="padding-top:22px;padding-bottom:0">验证码：</th>
                                    <td align="left" style="padding-bottom:0"><input name="seccode" type="text" size="30" class="input-text" style="width:280px;"><br><img id="img-seccode" src="https://www.tudu.im/img/spacer.gif" style="margin:14px 10px 10px 0;vertical-align:middle"><a href="javascript:void(0)" onclick="refreshSeccode();return false;">点击换一张</a></td>
                                </tr>
                                <tr>
                                    <th align="right">&nbsp;</th>
                                    <td align="left"><label for="remember"><input id="remember" name="remember" type="checkbox" value="1"><span class="gray">保持登录状态</span></label></td>
                                </tr>
                                <tr>
                                    <th align="right">&nbsp;</th>
                                    <td align="left"><button type="submit" class="btn"><span class="btn-left"><span class="btn-right"><span class="btn-inner" style="*width:40px;">登录</span></span></span></button>&nbsp;&nbsp;<a href="https://www.tudu.im/password/?oid=tuduoffice">忘记密码?</a></td>
                                </tr>
                                <tr>
                                    <th align="right">&nbsp;</th>
                                    <td align="left">&nbsp;</td>
                                </tr>
                            </tbody></table>
                        </form>
                    </div>
                </div>
            </div>
            <div class="clear"></div>
        </div>
    </div>
</div>

<div class="footer" id="footer">
    <p class="footer-link"><a href="#" target="_blank">隐私保护</a><a href="#" target="_blank">相关帮助</a><a href="https://www.tudu.im/suggest" target="_blank">反馈建议</a></p>
    <p class="copyright"><a href="#" target="_blank" style="margin-right:5px">京ICP备XXXXXXX号</a> Copyright © 2014 xxxx.com</p>
</div>

<script src="./js/jquery-1.4.4.js" type="text/javascript"></script>
<script type="text/javascript">
function getCookie(name) {
    var reg = new RegExp("(^| )" + name + "=([^;]*)(;|$)", "gi");
    var tmp = reg.exec(document.cookie);
    return unescape((tmp || [])[2] || "");
}

function setCookie(name, value) {
    document.cookie = name + '=' + escape(value)
            + ";expires=" + (new Date(2099, 12, 31)).toGMTString();
}

function refreshSeccode() {
    document.getElementById('img-seccode').src = 'https://www.tudu.im/seccode/?ns=login&sz=100x36&rand=' + Math.random();
    document.getElementById('seccode-tr').style.display = '';
}

function checkSeccode(isshow) {
    if (isshow) {
        refreshSeccode();
    }
}

function login() {
    var name = document.getElementById("uid").value;
    if (name.indexOf('@') < 0) {
        alert('无效的登录用户名');
        document.getElementById("uid").focus();
        return false;
    }

    setCookie("uid", name);
    return true;
}

function setLocation(elm, n) {
    if(n > elm.value.length)
        n = elm.value.length;
    if(elm.createTextRange) {   // IE
        var textRange = elm.createTextRange();
        textRange.moveStart('character', n);
        textRange.collapse();
        textRange.select();
    } else if(elm.setSelectionRange) { // Firefox
        elm.setSelectionRange(n, n);
        elm.focus();
    }
}
</script><script type="text/javascript">
(function(){
	var f = $('#footer').height(),
    h = $('#container-height').height(),
    mh = $('#main').outerHeight();

    function onResize(){
        var dh = document.body.offsetHeight;
            t = Math.max(30, Math.round(dh/2 - mh/2))
            height = dh - t - f - 1;

        $('#header').css('height', t + 'px');

        height = height > h ? height : h;

        $('#container-height').css('height',height);
    }
    window.onresize = onResize;

    onResize();

    $('input:text,input:password').bind('focus blur mouseover mouseout', function(e) {
        if (e.type == 'focus' || e.type == 'mouseover') {
            $(this).addClass('input-text-hover');
        } else {
            if (e.type == 'blur' || document.activeElement != this) {
                $(this).removeClass('input-text-hover');
            }
        }
    });

    $('#uid').bind('focus', function(){
        var v = this.value;
        if (v.indexOf('@') == -1) {
            this.value = v + '@tuduoffice';
            setLocation(this, 0);
        }
    });

    document.getElementById('loginform').onsubmit = function(){
        return login();
    };

    var name = getCookie("uid");

    if (name) {
        document.getElementById('uid').value = name;

        var arr = name.split('@'),
            name = arr[0] + '@' + (-1 != arr[1].indexOf('.') ? arr[1].substr(0, arr[1].indexOf('.')) : arr[1]);

        var avatar = document.getElementById('avatar');
        avatar.src = 'https://www.tudu.im/logo/?email=' + name;
        avatar.style.display = '';
        $('#password').focus();
    } else {
        $('#uid').focus();
    }

    })()
</script>
<script src="./seccode/check.js?cb=checkSeccode&amp;ns=login" type="text/javascript"></script>
</body></html>